Added cache-control headers to pages returned by HTTP server so that pages
authoremellor@ewan <emellor@ewan>
Fri, 30 Sep 2005 10:55:49 +0000 (11:55 +0100)
committeremellor@ewan <emellor@ewan>
Fri, 30 Sep 2005 10:55:49 +0000 (11:55 +0100)
expire immediately.  This prevents navigation to stale pages.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/web/http.py

index 5cabb95e248edc435696af9ceebad547d8a8f2b1..e11d8d29bd0df715bdf6e666c94810639b5684c1 100644 (file)
@@ -437,6 +437,9 @@ class HttpRequest:
         send_body = self.hasBody()
         if not self.close_connection:
             self.setResponseHeader("Connection", "keep-alive")
+        self.setResponseHeader("Pragma", "no-cache")
+        self.setResponseHeader("Cache-Control", "no-cache")
+        self.setResponseHeader("Expires", "-1")
         if send_body:
             self.output.seek(0, 0)
             body = self.output.getvalue()